
package com.tky.conference.utlils;


import android.app.Activity;
import android.widget.Toast;

public class ToastUtil {
    /**
     * Toast utils
     *
     */
    public static void showToast(final Activity context,final String msg){
        if("main".equals(Thread.currentThread().getName())){
            Toast toast=Toast.makeText(context, msg, Toast.LENGTH_SHORT);
            toast.show();
        }else{
            context.runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    Toast toast=Toast.makeText(context, msg, Toast.LENGTH_SHORT);

                    toast.show();
                }
            });
        }
    }
}
